<?php

use Alipay\EasySDK\Payment\Wap\Models\AlipayTradeWapPayResponse;
use App\Library\Pay\AliPayService;

class AliPay
{

    protected function initialize(array $config)
    {
        // TODO: Implement initialize() method.
    }

    /**
     * 创建订单发起支付
     * @param string $orderId
     * @param string $totalFee
     * @param string $attach
     * @param string $body
     * @param string $detail
     * @param string|null $tradeType
     * @param array $options
     * @return AlipayTradeWapPayResponse|mixed
     */
    public function create(string $orderId, string $totalFee, string $attach, string $body, string $detail, array $options = [])
    {
        $code = false;
       /* if (request()->isPC() || request()->isRoutine()) {
            $code = true;
        }*/

        return AliPayService::instance()->create($body, $orderId, $totalFee, $attach, $options['quitUrl'] ?? '', $options['returnUrl'] ?? '', $code);
    }
}
